package clientGUI;
import java.awt.Dimension;

import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import libraryManagerPanels.ReportsPanel;
import libraryManagerPanels.WatchEmployee;
import libraryManagerPanels.freezeSubscriptionPanel;

/**
 * @author Shay
 *		Creating Manager GUI
 */
public class ManagerGUI extends LibrarianGUI
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final static ManagerGUI mGUI=null;
	private JButton btnReports;
	private JButton btnEmployees;
	public static ManagerGUI getInstance()
	{
		if(mGUI==null)
			return new ManagerGUI();
		return mGUI;
	}
	
	private ManagerGUI() 
	{

		setPreferredSize(new Dimension(219, 547));
		btnWatchReaderCard.removeActionListener(btnWatchReaderCard.getActionListeners()[0]);
		btnWatchReaderCard.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) 
			{
				
				freezeSubscriptionPanel p =new freezeSubscriptionPanel();
				MainGUI.middlePanelChange(p);
				canceledButton.setEnabled(true);
				canceledButton=btnWatchReaderCard;
				canceledButton.setEnabled(false);

			}
		});
		btnReports = new JButton("Reports");
		btnReports.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ReportsPanel p=new ReportsPanel();
				MainGUI.middlePanelChange(p);
				canceledButton.setEnabled(true);
				canceledButton=btnReports;
				canceledButton.setEnabled(false);
			}
		});
		btnReports.setBounds(10, 325, 199, 41);
		add(btnReports);
		remove(labelbooks);
		add(labelbooks);
		
		btnEmployees = new JButton("Employees/Subscribers List");
		btnEmployees.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				WatchEmployee p=new WatchEmployee();
				MainGUI.middlePanelChange(p);
				canceledButton.setEnabled(true);
				canceledButton=btnEmployees;
				canceledButton.setEnabled(false);
			}
		});
		btnEmployees.setBounds(10, 376, 199, 41);
		add(btnEmployees);
		remove(labelbooks);
		add(labelbooks);
	}
}
